package com.qos.fun;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.webkit.WebSettings;
import android.webkit.WebView;

import com.qos.oauth.OAuthHelper;

public class WebViewActivity extends Activity
{
    private static final String LOG = "webviewact";
	private WebView	mWebView;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_webview);
		mWebView = (WebView) findViewById(R.id.WebView);
		
		WebSettings webSettings = mWebView.getSettings();                      
		webSettings.setJavaScriptEnabled(true);
		webSettings.setSavePassword(false);
		webSettings.setSaveFormData(false);
		
		mWebView.loadUrl(OAuthHelper.oauth_url);
	}
	
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		// TODO Auto-generated method stub		
		if(keyCode==KeyEvent.KEYCODE_BACK){			
			Intent it=new Intent();
			it.setClass(WebViewActivity.this, QosActivity.class);
			startActivity(it);
			WebViewActivity.this.finish();
			return true;
		}else{			
			return super.onKeyDown(keyCode, event);
		}
	}
	
}
